package cn.caskm.souvenirshopsystem.domain.po;

import cn.caskm.souvenirshopsystem.utils.DateUtils;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("seckill_goods")
public class SeckillGoods implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 秒杀商品ID
     */
    @TableId(value = "seckill_id", type = IdType.AUTO)
    private Integer seckillId;

    /**
     * 商品ID
     */
    private Integer goodsId;

    /**
     * 秒杀商品名称
     */
    private String seckillName;

    /**
     * 商品原价
     */
    private BigDecimal originalPrice;

    /**
     * 秒杀价格
     */
    private BigDecimal seckillPrice;

    /**
     * 秒杀库存
     */
    private Integer seckillStock;

    /**
     * 已秒杀数量
     */
    private Integer soldCount;

    /**
     * 每人限购数量
     */
    private Integer limitPerUser;

    /**
     * 秒杀状态 0:未开始 1:进行中 2:已结束 3:已取消
     */
    private String seckillStatus;

    /**
     * 秒杀开始时间
     */
    @JsonFormat(pattern = DateUtils.DATE_TIME_FORMAT)
    private LocalDateTime startTime;

    /**
     * 秒杀结束时间
     */
    @JsonFormat(pattern = DateUtils.DATE_TIME_FORMAT)
    private LocalDateTime endTime;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = DateUtils.DATE_TIME_FORMAT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = DateUtils.DATE_TIME_FORMAT)
    private LocalDateTime updateTime;

}
